#include<stdio.h>
int main()
{
    //freopen("in.txt","r",stdin);
    char a;
    while ((a = getchar()) != EOF)
    {
        if('a' <= a && a <= 'z') 
            printf("%c",a-'a'+'A');
        else
        if('A' <= a && a <= 'Z') 
            printf("%c",a-'A'+'a');
        else printf("%c",a);
    }
    
}